<!DOCTYPE html>
<html>
{include file="public/header" /}
<body>


<div class="layui-fluid" id="app" style="margin-top: 0px">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <!--<div class="layui-card-header">财务报表,提现管理</div>-->
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                        <ul class="layui-tab-title">
                            <li class="layui-this">店铺</li>
                            <li onclick="go('newdp')">新增店铺</li>

                        </ul>
                        <div class="layui-tab-content" style="padding-left: 0px;padding-right: 0px">

                            <div class="layui-tab-item layui-show">
                                <div class="layadmin-trailer ">


                                    <table class="layui-table" lay-skin="line">

                                        <thead>
                                        <tr>
                                            <!--<th></th>-->
                                            <th>店名</th>
                                            <th>地址</th>
                                            <th></th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(item,index) in items" :data_id="item.id">
                                            <!--<td style="width: 20px;text-align: center">-->
                                                <!--<input type="radio" class="vue_index" name="id" :value="index"-->
                                                       <!--style="zoom: 150%">-->
                                            <!--</td>-->
                                            <td>{{item.shop_name}}</td>
                                            <td>{{item.address}}</td>
                                            <td><div class="layui-btn-group" >
                                                <button class="layui-btn"  :data_index="index" onclick="sure_dp(this);" style="height: 30px;line-height: 30px">确定</button>
                                            </div></td>
                                        </tr>

                                        </tbody>
                                    </table>


                                </div>
                                <div id="demo7"></div>

                            </div>


                        </div>
                    </div>


                </div>


            </div>

        </div>


    </div>
</div>


<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    //vue对象
    var app = new Vue({
        el: '#app',
        data: {
            check: [],
            curr: 1,//当前页
            limit: 10,//当前页
            items: []
        }
    });

    //初始数据
    function init() {
        layer.load(2);
        $.get('/admin/goods/selectdp', {page: app.curr, limit: app.limit},
            function (res) {
                layer.closeAll();
                app.items = res.data;
            }
        );
    }
    //获取批量IDS
    // function getradio() {
    //     var check = [];
    //     $.each($('input[type=radio]:checked.vue_index'), function () {
    //         check.push($(this).val());
    //     });
    //     return check;
    // }
    //确定选中，向父页面传入uid 和店铺名称的值
    function sure_dp(that) {
        // var item=getradio();
        // var data_id = $(that).attr('data_id');
        var data_index = $(that).attr('data_index');
        var item=data_index;
        var dp=app.items[item];
        // console.log(dp);
        parent.dianpu(dp.uid,dp.shop_name);
        parent.layer.closeAll();

    }
    //按需引入layui模块
    layui.use(['laypage', 'layer', 'table', 'element'], function () {
        var laypage = layui.laypage
            , layer = layui.layer;
        var table = layui.table;
        var elemnet = layui.element;
        //完整功能
        laypage.render({
            elem: 'demo7'
            , count: "{$count}"
            , limits: [10, 20]
            , layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
            , jump: function (obj) {
                console.log(obj)
                app.curr = obj.curr;
                app.limit = obj.limit;
                init();
            }
        });

    });


</script>


</body>
</html>




